<html>
<head><meta charset="utf-8"><title>Bikeshed: Mask or SimdPredicate? · project-portable-simd · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/index.html">project-portable-simd</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html">Bikeshed: Mask or SimdPredicate?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="240864437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240864437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240864437">(May 31 2021 at 19:22)</a>:</h4>
<p>Hello, I was wondering: "mask" is a fairly SIMD-specific technical term, when really it's aimed at a more general concept. Do we have any appetite to consider a name like SimdPredicate or even the somewhat hilarious SimdBool?</p>



<a name="240864473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240864473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240864473">(May 31 2021 at 19:23)</a>:</h4>
<p>I had considered bool, the only weird thing is that there is a lane width as well</p>



<a name="240864571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240864571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240864571">(May 31 2021 at 19:24)</a>:</h4>
<p>Also, the only thing you can really do with them is <code>select</code>, which is masking I guess?</p>



<a name="240864588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240864588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240864588">(May 31 2021 at 19:24)</a>:</h4>
<p>That <strong>does</strong> make it a bit weird, but I would contend that basically that detail is opaque even if it comes up.<br>
True, but that kind of makes it a <code>filter</code>, no?</p>



<a name="240864596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240864596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240864596">(May 31 2021 at 19:24)</a>:</h4>
<p>well, it's an Either, actually.</p>



<a name="240864601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240864601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240864601">(May 31 2021 at 19:24)</a>:</h4>
<p>Perhaps</p>



<a name="240864610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240864610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240864610">(May 31 2021 at 19:24)</a>:</h4>
<p><code>.zip().map()</code></p>



<a name="240864630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240864630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240864630">(May 31 2021 at 19:25)</a>:</h4>
<p>Select is probably more plain-english</p>



<a name="240864648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240864648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240864648">(May 31 2021 at 19:25)</a>:</h4>
<p>Yeah, I think select as a method is fine, my only concern is the type/trait names involved (why do we involve a "mask" in selecting?)</p>



<a name="240864649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240864649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240864649">(May 31 2021 at 19:25)</a>:</h4>
<p>Since it's really like <code>if</code>.  Which does make it a condition/predicate result</p>



<a name="240864696"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240864696" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240864696">(May 31 2021 at 19:26)</a>:</h4>
<p>yup.</p>



<a name="240864712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240864712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240864712">(May 31 2021 at 19:26)</a>:</h4>
<p>I agree that mask is probably historical from when it was logical masking operations (not true on all architectures today!)</p>



<a name="240864857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240864857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240864857">(May 31 2021 at 19:28)</a>:</h4>
<p>Yeah. I don't mind a few historical names appearing, as long as we like them enough to stand up for them against alternatives, thus this initial foray into testing our feelings about it.</p>



<a name="240865893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240865893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240865893">(May 31 2021 at 19:46)</a>:</h4>
<p>SimdBool would likely make the most sense except SimdBool32 is... confusing</p>



<a name="240866202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240866202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240866202">(May 31 2021 at 19:50)</a>:</h4>
<p>yeaaah.</p>



<a name="240866372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240866372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240866372">(May 31 2021 at 19:53)</a>:</h4>
<p>You could do <code>SimdBool&lt;T: SimdBoolHelper&gt;</code> and implement <code>SimdBoolHelper</code> for <code>SimdI{N}</code></p>



<a name="240866579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240866579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240866579">(May 31 2021 at 19:56)</a>:</h4>
<p>I think mask makes way more sense given the lane width. I also think "bitmask" is not at all a simd-specific concept</p>



<a name="240866649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240866649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240866649">(May 31 2021 at 19:57)</a>:</h4>
<p>I think the oddity is we aren't calling it a bitmask because a bitmask means something specific, tho'.</p>



<a name="240866745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240866745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240866745">(May 31 2021 at 19:58)</a>:</h4>
<p>Well, perhaps it does only because we gave bitmask a special meaning</p>



<a name="240866777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240866777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240866777">(May 31 2021 at 19:59)</a>:</h4>
<p>Intel people would probably call it a "k mask" or something like that</p>



<a name="240866866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240866866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240866866">(May 31 2021 at 20:00)</a>:</h4>
<p>yeah. And Arm people might call it a predicate vector. RISCV people would in fact call it a mask, but also a predicate, Because.</p>



<a name="240867019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240867019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240867019">(May 31 2021 at 20:02)</a>:</h4>
<p>I think mask or bool is easiest in terms of familiarity and keeping the verbiage simple</p>



<a name="240867512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240867512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240867512">(May 31 2021 at 20:09)</a>:</h4>
<p>I am actually leaning towards bool, since it's also used for the results of comparisons</p>



<a name="240868239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240868239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240868239">(May 31 2021 at 20:20)</a>:</h4>
<p><span class="user-mention silent" data-user-id="281757">Jubilee</span> <a href="#narrow/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F/near/240864437">said</a>:</p>
<blockquote>
<p>Hello, I was wondering: "mask" is a fairly SIMD-specific technical term, when really it's aimed at a more general concept. Do we have any appetite to consider a name like SimdPredicate or even the somewhat hilarious SimdBool?</p>
</blockquote>
<p>I think anything involving "predicate" would be confusing, as that would make me think of instructions that accept an "operation" or "predicate" code to indicate something like "eq" or "lt" or "ge" for each pair of somethings.</p>



<a name="240868283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240868283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240868283">(May 31 2021 at 20:21)</a>:</h4>
<p>I think it'd be important to distinguish between a vector of mask/select/"actually do the thing in this lane" bits and a vector of predicate/operation/condition codes.</p>



<a name="240869043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240869043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240869043">(May 31 2021 at 20:33)</a>:</h4>
<p>For <code>vector-math</code>, I just used <code>VecBool32</code>, inspired by SPIR-V's use of <code>bool</code>-vectors.</p>



<a name="240869130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240869130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240869130">(May 31 2021 at 20:34)</a>:</h4>
<p>where <code>VecBool32</code> means a generic-length vector of booleans for 32-bit lanes.</p>



<a name="240869384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240869384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240869384">(May 31 2021 at 20:38)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F/near/240868283">said</a>:</p>
<blockquote>
<p>I think it'd be important to distinguish between a vector of mask/select/"actually do the thing in this lane" bits and a vector of predicate/operation/condition codes.</p>
</blockquote>
<p>well, the latter tends to feed into the former.</p>



<a name="240878710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240878710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240878710">(May 31 2021 at 23:16)</a>:</h4>
<p>In the context of a particular instruction set I could see a distinction, but in our use case I think it is either just true or false.  Considering we don't actually even expose the format of the bits</p>



<a name="240885213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240885213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240885213">(Jun 01 2021 at 01:19)</a>:</h4>
<p>I think given that the mask size is part of the type, bool is probably more confusing than mask. I think you're greatly overestimating how foreign a concept of a mask is to people who haven't done simd, again, the analogy to bitmasks isn't that wrong or far of a stretch</p>



<a name="240885267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240885267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240885267">(Jun 01 2021 at 01:20)</a>:</h4>
<p>whereas having like, $N different kinds of bools probably would be</p>



<a name="240885406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240885406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240885406">(Jun 01 2021 at 01:24)</a>:</h4>
<p>Yeah, I agree that "mask" isn't that far of a stretch.  But if we reorganized it as <code>SimdBool&lt;T&gt;</code> it's really just one type (we could also make the argument that it should be <code>Mask&lt;T&gt;</code> which may be simplest and least confusing?)</p>



<a name="240885449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240885449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240885449">(Jun 01 2021 at 01:25)</a>:</h4>
<p><code>pub type Mask32&lt;LANES&gt; = Mask&lt;SimdI32&lt;LANES&gt;&gt;</code> etc</p>



<a name="240886331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240886331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240886331">(Jun 01 2021 at 01:44)</a>:</h4>
<p>oh dear. ^^;</p>



<a name="240889010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240889010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240889010">(Jun 01 2021 at 02:41)</a>:</h4>
<p>Urgh.</p>



<a name="240889068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240889068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240889068">(Jun 01 2021 at 02:42)</a>:</h4>
<p>I have been trying to define an actual trait for use and the trait bounds that we've defined are driving me mad.</p>



<a name="240889091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240889091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240889091">(Jun 01 2021 at 02:43)</a>:</h4>
<p>Ugh TIL RiscV and Arm are not the same thing...</p>



<a name="240889099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240889099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240889099">(Jun 01 2021 at 02:43)</a>:</h4>
<p>Even more ISAs to learn!</p>



<a name="240889103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240889103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240889103">(Jun 01 2021 at 02:43)</a>:</h4>
<p><span class="user-mention" data-user-id="281757">@Jubilee</span> go on?</p>



<a name="240889449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240889449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240889449">(Jun 01 2021 at 02:51)</a>:</h4>
<p>I don't advise learning the fine details of all the different ISAs.<br>
<span class="user-mention" data-user-id="312331">@Caleb Zulawski</span> I have been experimenting with the proposed idea of a trait that parameterizes over lanes, conceptually, and basically I've gotten stuck on getting all the trait bounds to resolve because every time I slap one bound in another erupts, and the fact that MaskSize is sometimes an Isize leaks out.</p>



<a name="240889520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240889520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240889520">(Jun 01 2021 at 02:53)</a>:</h4>
<p>So masks require <code>Self: Mask, SimdI{N}: LanesAtMost32</code>, which is what I assume you're seeing</p>



<a name="240889585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240889585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240889585">(Jun 01 2021 at 02:54)</a>:</h4>
<p>...</p>



<a name="240889588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240889588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240889588">(Jun 01 2021 at 02:54)</a>:</h4>
<p>well.</p>



<a name="240889591"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240889591" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240889591">(Jun 01 2021 at 02:55)</a>:</h4>
<p>I got it to compile, but then rustc panicked.</p>



<a name="240889595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240889595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240889595">(Jun 01 2021 at 02:55)</a>:</h4>
<p>Lol.</p>



<a name="240889807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240889807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240889807">(Jun 01 2021 at 03:00)</a>:</h4>
<p>And I can't actually use MaskSize as an argument to an intrinsic expecting a SIMD type.</p>



<a name="240889827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240889827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240889827">(Jun 01 2021 at 03:01)</a>:</h4>
<p>Well, masks aren't (necessarily) vectors?</p>



<a name="240889879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240889879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240889879">(Jun 01 2021 at 03:02)</a>:</h4>
<p>technically true, but it's expecting a mask.</p>



<a name="240889900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240889900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240889900">(Jun 01 2021 at 03:03)</a>:</h4>
<p>You can use <code>mask.to_int().into()</code> to get the architecture vector type</p>



<a name="240889954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240889954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240889954">(Jun 01 2021 at 03:04)</a>:</h4>
<p>Assuming you mean a <code>core::arch</code> intrinsic</p>



<a name="240890055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240890055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240890055">(Jun 01 2021 at 03:06)</a>:</h4>
<p>no, this is the LLVM intrinsics</p>



<a name="240890057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240890057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240890057">(Jun 01 2021 at 03:06)</a>:</h4>
<p>but it worked anyways.</p>



<a name="240890069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Bikeshed%3A%20Mask%20or%20SimdPredicate%3F/near/240890069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Bikeshed.3A.20Mask.20or.20SimdPredicate.3F.html#240890069">(Jun 01 2021 at 03:07)</a>:</h4>
<p>I think you can skip the <code>into</code> then, but same idea</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>